using UnityEngine;

namespace Brick
{
	public class gdk_mainCamera : MonoBehaviour
	{
		public static float getTimes()
		{
			float num = Screen.height;
			float num2 = Screen.width;
			float num3 = num * 720f / num2;
			return num3 / 1280f;
		}

		protected virtual void Awake()
		{
			if (Application.isPlaying)
			{
				Camera component = base.gameObject.GetComponent<Camera>();
				component.backgroundColor = Color.black;
				float times = getTimes();
				if (times < 1f)
				{
					float x = (1f - times) / 2f;
					component.rect = new Rect(x, 0f, times, 1f);
				}
				else if (times > 1f)
				{
					float y = (1f - 1f / times) / 2f;
					component.rect = new Rect(0f, y, 1f, 1f / times);
				}
			}
			Resolution[] resolutions = Screen.resolutions;
			Screen.SetResolution(resolutions[resolutions.Length - 1].width, resolutions[resolutions.Length - 1].height, fullscreen: true);
			Screen.fullScreen = true;
		}
	}
}

